<let/x = 1 />
<script>
  document.getElementById("ref").textContent = x;
</script>
<div id="ref">0</div>